import logging


class Config(object):
    SECRET_KEY = "iECgbYWReMNxkRprrzMo5KAQYnb2UeZ3bwvReTSt+VSESW0OB8zbglT+6rEcDW9X"
    SQLALCHEMY_DATABASE_URI = "mysql://root:mysql@127.0.0.1:3306/information"
    SQLALCHEMY_TRACK_MODIFICATIONS = False
    # 设置session存储的位置
    SESSION_TYPE = "redis"
    # 设置证书验证
    SESSION_USE_SIGNER = True
    # 是否设置过期时间
    SESSION_PERMANENT = False
    # 设置过期时间
    PERMANENT_SESSION_LIFETIME = 86400
    REDIS_HOST = "127.0.0.1"
    REDIS_PORT = 6379


class DevelopmentConfig(Config):
    DEBUG = True
    LOG_LEAVE = logging.DEBUG



class ProductionConfig(Config):
    DEBUG = False
    LOG_LEAVE = logging.WARNING

config = {"development": DevelopmentConfig, "production": ProductionConfig}
